const mongoose = require('mongoose');

// mongodb服务的用户名、密码
const uname = 'xxx',
      upwd = 'xxx';

// mongodb服务地址
const url = [
    // '127.0.0.1:27017/imagepic'
];

// console.log(`mongodb://${uname}:${upwd}@${url.join(',')}`)


async function db() {
    await mongoose.connect(`mongodb://${uname}:${upwd}@${url.join(',')}`);
}

exports.db = db;

exports.mongoose = mongoose;